import request from './axios';

const get = (url, data) =>
  new Promise((resolve, reject) => {
    request
      .get(url, {
        params: data
      })
      .then((res) => {
        resolve(res);
      })
      .catch((err) => {
        reject(err);
      });
  });
const post = (url, data) =>
  new Promise((resolve, reject) => {
    request
      .post(url, data)
      .then((res) => {
        resolve(res);
      })
      .catch((err) => {
        reject(err);
      });
  });

const del = (url, data) => request.delete(url, { params: data });
export { get, post, del };
